

all:
	mkdir -p static
	# GOOS=js GOARCH=wasm go build -ldflags="-s -w" -tags=netgo -o static/main.wasm main.go
	tinygo build -o static/main.wasm -target wasm ./main.go

# build: all
	# cp $(shell go env GOROOT)/misc/wasm/wasm_exec.js static
	cp $(shell tinygo env TINYGOROOT)/targets/wasm_exec.js static



run:all
	goexec 'http.ListenAndServe(`:9999`, http.FileServer(http.Dir(`static`)))'

